import {
	config
} from '@/config'
import {
	get,
	post,
	postBody,
	getNoAuth,
	postNoAuth,
	postBodyNoAuth
} from '@/common/js/request.js'

// 验证码渲染图片接口
export const drawCodeImage = `${config.baseApi}/common/captcha/draw/`

// 初始化验证码
export const initCaptcha = (params) => {
    return getNoAuth('/common/captcha/init?isDigit=true', params)
}
// 登录
export const login = (params) => {
	return postNoAuth('/auth/login', params)
}
// 扫码登录
export const scanLogin = (params) => {
	return postNoAuth('/auth/scanLogin', params)
}
// 获取用户登录信息
export const userInfo = (params) => {
    return get('/user/info', params)
}
// 发送登录短信验证码
export const sendLoginSms = (mobile, params) => {
    return getNoAuth(`/common/captcha/sendLoginSms/${mobile}`, params)
}
// 短信验证码登录
export const smsLogin = (params) => {
    return postNoAuth('/auth/smsLogin', params)
}
// 发送重置密码短信验证码
export const sendResetSms = (mobile, params) => {
    return getNoAuth(`/common/captcha/sendResetSms/${mobile}`, params)
}
// 通过手机重置密码
export const resetByMobile = (params) => {
    return postNoAuth('/auth/resetByMobile', params)
}


